function GM:PlayerNoClip( pl, on )
    return false
    //return true
end

local pl = FindMetaTable("Player")

if SERVER then
	function pl:EnergyAdd(amount)
		self:EnergySet(self:Energy() + amount)
	end
	 
	function pl:EnergySet(amount)
		self:SetNetworkedInt("LuaHudEnergy", math.Round(amount))
	end
	function pl:EnergyConsume(amount)
		self:EnergySet(self:Energy() -amount)
	end
end

function pl:Energy()
	return self:GetNetworkedInt("LuaHudEnergy") or 0
end

if SERVER then
	local function ResetEnergy(victim,weapon,killer)
		if victim:IsPlayer() then
			victim:EnergySet(0)
		end
	end
	hook.Add("PlayerDeath", "HUD_ENERGY_RESET", ResetEnergy)
	hook.Add("PlayerSilentDeath", "HUD_ENERGY_RESET2",function(ply)
		if ply:IsPlayer() then
			ply:EnergySet(0)
		end
	end)
end